<!DOCTYPE html>
<html>
<head>
    <title>仓库</title>
    #parse("sys/header.html")
    <style>
        .ui-jqgrid {
            width: 100%;
            float: right;
        }
        .leftHeight{
            height: 85vh;
            overflow: auto;
        }
        ::-webkit-scrollbar{
            width: 10px;
            height: 10px;
        }
        ::-webkit-scrollbar-thumb{
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
            background: #a8a5a5;
        }
        .workShop{
            position: absolute;
            top: 0;
            width: 100%;
            height: 25px;
            background-color: white;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.storeCode" @on-enter="query" placeholder="仓库代码"></i-input>
                </i-col>
                <i-col span="4">
                    <i-select v-model="q.storeType" placeholder="仓库类型">
                        <i-option v-for="item in storeTypeList" :value="item.value" :key="item.value">{{item.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-col span="4">
                    <i-select v-model="q.moduleType" placeholder="模块类型">
                        <i-option v-for="item in moduleTypeList" :value="item.value" :key="item.value">{{item.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("storehouse:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("storehouse:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("storehouse:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <Row  :gutter="16" style="margin: 8px 0px 0px 1px;">
            <i-col :xs="3" :sm="3" :md="3" :lg="3">
                <div class="leftHeight" >
                    <div >
                        <p class="text-center" style="font-size: 15px;">仓库</p>
                    </div>
                    <div id="storeLayer" style="margin-top: 25px">
                        <ul id="storeTree" class="ztree"></ul>
                    </div>
                </div>
            </i-col>
            <i-col :xs="21" :sm="21" :md="21" :lg="21">
                <table  id="jqGrid"></table>
            </i-col>
        </Row>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="storeHouse" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="仓库代码" prop="storeCode">
                        <i-input v-model="storeHouse.storeCode" placeholder="仓库代码" readonly></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="仓库名称" prop="name">
                        <i-input v-model="storeHouse.name" placeholder="仓库名称"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="仓库类型" prop="storeType">
                        <i-select v-model="storeHouse.storeType" placeholder="仓库类型">
                            <i-option v-for="item in storeTypeList" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                        <!--<i-input v-model="storeHouse.storeType" placeholder="仓库类型"/>-->
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="模块类型" prop="moduleType">
                        <i-select v-model="storeHouse.moduleType" placeholder="模块类型">
                            <i-option v-for="item in moduleTypeList" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="工厂名称" prop="deptName">
                        <i-input v-model="storeHouse.deptName" placeholder="工厂名称"></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="所属车间" prop="workshopName">
                        <i-input v-model="storeHouse.workshopName" placeholder="所属车间" icon="md-arrow-dropdown-circle"  readonly
                                 @on-click="deptTreeShow"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="简称" prop="shortName">
                        <i-input v-model="storeHouse.shortName" placeholder="仓库简称，一般用于全称过长无法展示的场景"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="22">
                    <Form-item label="备注信息" prop="remark">
                        <i-input type="textarea" v-model="storeHouse.remark" placeholder="备注信息"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>
<div id="deptLayer" style="display: none;padding:10px;">
    <ul id="deptTree" class="ztree"></ul>
</div>
<script src="${rc.contextPath}/js/sys/storehouse.js?_${date.systemTime}"></script>
</body>
</html>
